package colibri.lcdui;


import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 * @author Bayron Thiengo Quinelato
 */
public class ImageItem extends Item {

    private Image img;

    public ImageItem(Image img, int x, int y, int anchor) {
        super(x, y, img.getWidth(), img.getHeight(), anchor);
        if (img == null) {
            throw new NullPointerException("Colibri error: Falha ao criar ImageItem. O agumento 'img' é nulo.");
        }
        this.img = img;
    }

    protected void callPaint(Graphics g) {
        g.drawImage(img, x, y, anchor);
    }
}
